
// Generated from ./ANTLRv4Parser.g4 by ANTLR 4.8

#pragma once


#include <string>
#include "../ANTLRv4ParserBase.hpp"


#include "antlr4-runtime.h"


using boolean = bool;
using CppString = std::string;




class  ANTLRv4Parser : public ANTLRv4ParserBase {
public:
  enum {
    TOKEN_REF = 1, RULE_REF = 2, LEXER_CHAR_SET = 3, DOC_COMMENT = 4, BLOCK_COMMENT = 5, 
    LINE_COMMENT = 6, DOUBLE_QUOTE_STRING_LITERAL = 7, BEGIN_ARG_ACTION = 8, 
    BEGIN_ACTION = 9, OPTIONS = 10, TOKENS = 11, IMPORT = 12, FRAGMENT = 13, 
    LEXER = 14, PARSER = 15, GRAMMAR = 16, PROTECTED = 17, PUBLIC = 18, 
    PRIVATE = 19, RETURNS = 20, LOCALS = 21, THROWS = 22, CATCH = 23, FINALLY = 24, 
    MODE = 25, COLON = 26, COLONCOLON = 27, COMMA = 28, SEMI = 29, LPAREN = 30, 
    RPAREN = 31, RARROW = 32, LT = 33, GT = 34, ASSIGN = 35, QUESTION = 36, 
    STAR = 37, PLUS = 38, PLUS_ASSIGN = 39, OR = 40, DOLLAR = 41, DOT = 42, 
    RANGE = 43, AT = 44, POUND = 45, NOT = 46, RBRACE = 47, ID = 48, INT = 49, 
    STRING_LITERAL = 50, WS = 51, ERRCHAR = 52, ARG_ACTION_LT = 53, ARG_ACTION_GT = 54, 
    ARG_ACTION_LPAREN = 55, ARG_ACTION_RPAREN = 56, ARG_ACTION_EQUALS = 57, 
    ARG_ACTION_COMMA = 58, ARG_ACTION_ESCAPE = 59, ARG_ACTION_WORD = 60, 
    ARG_ACTION_ELEMENT = 61, ARG_ACTION_TEXT = 62, ARG_ACTION_WS = 63, ARG_ACTION_NEWLINE = 64, 
    END_ARG_ACTION = 65, ACTION_DOT = 66, ACTION_LT = 67, ACTION_GT = 68, 
    ACTION_LPAREN = 69, ACTION_RPAREN = 70, ACTION_LBRACK = 71, ACTION_RBRACK = 72, 
    ACTION_EQUALS = 73, ACTION_COMMA = 74, ACTION_COLON2 = 75, ACTION_COLON = 76, 
    ACTION_MINUS = 77, ACTION_ESCAPE = 78, ACTION_WORD = 79, ACTION_REFERENCE = 80, 
    ACTION_COMMENT = 81, ACTION_LITERAL = 82, ACTION_TEXT = 83, ACTION_WS = 84, 
    ACTION_NEWLINE = 85, END_ACTION = 86, COMBINED = 87
  };

  enum {
    RuleGrammarSpec = 0, RuleGrammarType = 1, RulePrequelConstruct = 2, 
    RuleOptionsSpec = 3, RuleOption = 4, RuleOptionValue = 5, RuleDelegateGrammars = 6, 
    RuleDelegateGrammar = 7, RuleTokensSpec = 8, RuleActionBlock = 9, RuleActionExpression = 10, 
    RuleActionScopeExpression = 11, RuleArgActionBlock = 12, RuleArgActionParameters = 13, 
    RuleArgActionParameter = 14, RuleArgActionParameterType = 15, RuleArgActionParameterTypePart = 16, 
    RuleIgnored = 17, RuleAction = 18, RuleActionScopeName = 19, RuleModeSpec = 20, 
    RuleRules = 21, RuleRuleSpec = 22, RuleParserRuleSpec = 23, RuleExceptionGroup = 24, 
    RuleExceptionHandler = 25, RuleFinallyClause = 26, RuleRulePrequels = 27, 
    RuleRulePrequel = 28, RuleRuleReturns = 29, RuleThrowsSpec = 30, RuleLocalsSpec = 31, 
    RuleRuleAction = 32, RuleRuleModifiers = 33, RuleRuleModifier = 34, 
    RuleRuleBlock = 35, RuleRuleAltList = 36, RuleLabeledAlt = 37, RuleLexerRule = 38, 
    RuleLexerRuleBlock = 39, RuleLexerAltList = 40, RuleLexerAlt = 41, RuleLexerElements = 42, 
    RuleLexerElement = 43, RuleLabeledLexerElement = 44, RuleLexerBlock = 45, 
    RuleLexerCommands = 46, RuleLexerCommand = 47, RuleLexerCommandName = 48, 
    RuleLexerCommandExpr = 49, RuleAltList = 50, RuleAlternative = 51, RuleElements = 52, 
    RuleElement = 53, RuleLabeledElement = 54, RuleEbnf = 55, RuleBlockSuffix = 56, 
    RuleEbnfSuffix = 57, RuleLexerAtom = 58, RuleAtom = 59, RuleNotSet = 60, 
    RuleBlockSet = 61, RuleSetElement = 62, RuleBlock = 63, RuleRuleref = 64, 
    RuleRange = 65, RuleTerminal = 66, RuleElementOptions = 67, RuleElementOption = 68, 
    RuleId = 69, RuleQid = 70
  };

  ANTLRv4Parser(antlr4::TokenStream *input);
  ~ANTLRv4Parser();

  virtual std::string getGrammarFileName() const override;
  virtual const antlr4::atn::ATN& getATN() const override { return _atn; };
  virtual const std::vector<std::string>& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead.
  virtual const std::vector<std::string>& getRuleNames() const override;
  virtual antlr4::dfa::Vocabulary& getVocabulary() const override;


  /* public parser declarations/members section */


  class GrammarSpecContext;
  class GrammarTypeContext;
  class PrequelConstructContext;
  class OptionsSpecContext;
  class OptionContext;
  class OptionValueContext;
  class DelegateGrammarsContext;
  class DelegateGrammarContext;
  class TokensSpecContext;
  class ActionBlockContext;
  class ActionExpressionContext;
  class ActionScopeExpressionContext;
  class ArgActionBlockContext;
  class ArgActionParametersContext;
  class ArgActionParameterContext;
  class ArgActionParameterTypeContext;
  class ArgActionParameterTypePartContext;
  class IgnoredContext;
  class ActionContext;
  class ActionScopeNameContext;
  class ModeSpecContext;
  class RulesContext;
  class RuleSpecContext;
  class ParserRuleSpecContext;
  class ExceptionGroupContext;
  class ExceptionHandlerContext;
  class FinallyClauseContext;
  class RulePrequelsContext;
  class RulePrequelContext;
  class RuleReturnsContext;
  class ThrowsSpecContext;
  class LocalsSpecContext;
  class RuleActionContext;
  class RuleModifiersContext;
  class RuleModifierContext;
  class RuleBlockContext;
  class RuleAltListContext;
  class LabeledAltContext;
  class LexerRuleContext;
  class LexerRuleBlockContext;
  class LexerAltListContext;
  class LexerAltContext;
  class LexerElementsContext;
  class LexerElementContext;
  class LabeledLexerElementContext;
  class LexerBlockContext;
  class LexerCommandsContext;
  class LexerCommandContext;
  class LexerCommandNameContext;
  class LexerCommandExprContext;
  class AltListContext;
  class AlternativeContext;
  class ElementsContext;
  class ElementContext;
  class LabeledElementContext;
  class EbnfContext;
  class BlockSuffixContext;
  class EbnfSuffixContext;
  class LexerAtomContext;
  class AtomContext;
  class NotSetContext;
  class BlockSetContext;
  class SetElementContext;
  class BlockContext;
  class RulerefContext;
  class RangeContext;
  class TerminalContext;
  class ElementOptionsContext;
  class ElementOptionContext;
  class IdContext;
  class QidContext; 

  class  GrammarSpecContext : public antlr4::ParserRuleContext {
  public:
    GrammarSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    GrammarTypeContext *grammarType();
    IdContext *id();
    antlr4::tree::TerminalNode *SEMI();
    RulesContext *rules();
    antlr4::tree::TerminalNode *EOF();
    antlr4::tree::TerminalNode *DOC_COMMENT();
    std::vector<PrequelConstructContext *> prequelConstruct();
    PrequelConstructContext* prequelConstruct(size_t i);
    std::vector<ModeSpecContext *> modeSpec();
    ModeSpecContext* modeSpec(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  GrammarSpecContext* grammarSpec();

  class  GrammarTypeContext : public antlr4::ParserRuleContext {
  public:
    GrammarTypeContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LEXER();
    antlr4::tree::TerminalNode *GRAMMAR();
    antlr4::tree::TerminalNode *PARSER();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  GrammarTypeContext* grammarType();

  class  PrequelConstructContext : public antlr4::ParserRuleContext {
  public:
    PrequelConstructContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    OptionsSpecContext *optionsSpec();
    DelegateGrammarsContext *delegateGrammars();
    TokensSpecContext *tokensSpec();
    ActionContext *action();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  PrequelConstructContext* prequelConstruct();

  class  OptionsSpecContext : public antlr4::ParserRuleContext {
  public:
    OptionsSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *OPTIONS();
    antlr4::tree::TerminalNode *RBRACE();
    std::vector<OptionContext *> option();
    OptionContext* option(size_t i);
    std::vector<antlr4::tree::TerminalNode *> SEMI();
    antlr4::tree::TerminalNode* SEMI(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  OptionsSpecContext* optionsSpec();

  class  OptionContext : public antlr4::ParserRuleContext {
  public:
    OptionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *ASSIGN();
    OptionValueContext *optionValue();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  OptionContext* option();

  class  OptionValueContext : public antlr4::ParserRuleContext {
  public:
    OptionValueContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    QidContext *qid();
    antlr4::tree::TerminalNode *STRING_LITERAL();
    antlr4::tree::TerminalNode *INT();
    antlr4::tree::TerminalNode *STAR();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  OptionValueContext* optionValue();

  class  DelegateGrammarsContext : public antlr4::ParserRuleContext {
  public:
    DelegateGrammarsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *IMPORT();
    std::vector<DelegateGrammarContext *> delegateGrammar();
    DelegateGrammarContext* delegateGrammar(size_t i);
    antlr4::tree::TerminalNode *SEMI();
    std::vector<antlr4::tree::TerminalNode *> COMMA();
    antlr4::tree::TerminalNode* COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  DelegateGrammarsContext* delegateGrammars();

  class  DelegateGrammarContext : public antlr4::ParserRuleContext {
  public:
    DelegateGrammarContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<IdContext *> id();
    IdContext* id(size_t i);
    antlr4::tree::TerminalNode *ASSIGN();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  DelegateGrammarContext* delegateGrammar();

  class  TokensSpecContext : public antlr4::ParserRuleContext {
  public:
    TokensSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *TOKENS();
    std::vector<IdContext *> id();
    IdContext* id(size_t i);
    antlr4::tree::TerminalNode *RBRACE();
    std::vector<antlr4::tree::TerminalNode *> COMMA();
    antlr4::tree::TerminalNode* COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  TokensSpecContext* tokensSpec();

  class  ActionBlockContext : public antlr4::ParserRuleContext {
  public:
    ActionBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *BEGIN_ACTION();
    antlr4::tree::TerminalNode *END_ACTION();
    std::vector<ActionBlockContext *> actionBlock();
    ActionBlockContext* actionBlock(size_t i);
    std::vector<ActionExpressionContext *> actionExpression();
    ActionExpressionContext* actionExpression(size_t i);
    std::vector<ActionScopeExpressionContext *> actionScopeExpression();
    ActionScopeExpressionContext* actionScopeExpression(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_WS();
    antlr4::tree::TerminalNode* ACTION_WS(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_NEWLINE();
    antlr4::tree::TerminalNode* ACTION_NEWLINE(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_COMMENT();
    antlr4::tree::TerminalNode* ACTION_COMMENT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_LITERAL();
    antlr4::tree::TerminalNode* ACTION_LITERAL(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_TEXT();
    antlr4::tree::TerminalNode* ACTION_TEXT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_LT();
    antlr4::tree::TerminalNode* ACTION_LT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_GT();
    antlr4::tree::TerminalNode* ACTION_GT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_LPAREN();
    antlr4::tree::TerminalNode* ACTION_LPAREN(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_RPAREN();
    antlr4::tree::TerminalNode* ACTION_RPAREN(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_LBRACK();
    antlr4::tree::TerminalNode* ACTION_LBRACK(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_RBRACK();
    antlr4::tree::TerminalNode* ACTION_RBRACK(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_EQUALS();
    antlr4::tree::TerminalNode* ACTION_EQUALS(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_COMMA();
    antlr4::tree::TerminalNode* ACTION_COMMA(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_ESCAPE();
    antlr4::tree::TerminalNode* ACTION_ESCAPE(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_WORD();
    antlr4::tree::TerminalNode* ACTION_WORD(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_REFERENCE();
    antlr4::tree::TerminalNode* ACTION_REFERENCE(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_COLON();
    antlr4::tree::TerminalNode* ACTION_COLON(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_COLON2();
    antlr4::tree::TerminalNode* ACTION_COLON2(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_MINUS();
    antlr4::tree::TerminalNode* ACTION_MINUS(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ACTION_DOT();
    antlr4::tree::TerminalNode* ACTION_DOT(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ActionBlockContext* actionBlock();

  class  ActionExpressionContext : public antlr4::ParserRuleContext {
  public:
    antlr4::Token *ref = nullptr;;
    antlr4::Token *op = nullptr;;
    antlr4::Token *member = nullptr;;
    ActionExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *ACTION_REFERENCE();
    antlr4::tree::TerminalNode *ACTION_DOT();
    antlr4::tree::TerminalNode *ACTION_WORD();
    std::vector<IgnoredContext *> ignored();
    IgnoredContext* ignored(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ActionExpressionContext* actionExpression();

  class  ActionScopeExpressionContext : public antlr4::ParserRuleContext {
  public:
    antlr4::Token *ref = nullptr;;
    antlr4::Token *neg = nullptr;;
    antlr4::Token *index = nullptr;;
    antlr4::Token *op = nullptr;;
    antlr4::Token *member = nullptr;;
    ActionScopeExpressionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *ACTION_REFERENCE();
    antlr4::tree::TerminalNode *ACTION_COLON2();
    std::vector<antlr4::tree::TerminalNode *> ACTION_WORD();
    antlr4::tree::TerminalNode* ACTION_WORD(size_t i);
    std::vector<IgnoredContext *> ignored();
    IgnoredContext* ignored(size_t i);
    antlr4::tree::TerminalNode *ACTION_LBRACK();
    antlr4::tree::TerminalNode *ACTION_RBRACK();
    antlr4::tree::TerminalNode *ACTION_MINUS();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ActionScopeExpressionContext* actionScopeExpression();

  class  ArgActionBlockContext : public antlr4::ParserRuleContext {
  public:
    ArgActionBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *BEGIN_ARG_ACTION();
    antlr4::tree::TerminalNode *END_ARG_ACTION();
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_ELEMENT();
    antlr4::tree::TerminalNode* ARG_ACTION_ELEMENT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_TEXT();
    antlr4::tree::TerminalNode* ARG_ACTION_TEXT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_LT();
    antlr4::tree::TerminalNode* ARG_ACTION_LT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_GT();
    antlr4::tree::TerminalNode* ARG_ACTION_GT(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_LPAREN();
    antlr4::tree::TerminalNode* ARG_ACTION_LPAREN(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_RPAREN();
    antlr4::tree::TerminalNode* ARG_ACTION_RPAREN(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_EQUALS();
    antlr4::tree::TerminalNode* ARG_ACTION_EQUALS(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_COMMA();
    antlr4::tree::TerminalNode* ARG_ACTION_COMMA(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_ESCAPE();
    antlr4::tree::TerminalNode* ARG_ACTION_ESCAPE(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_WORD();
    antlr4::tree::TerminalNode* ARG_ACTION_WORD(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_WS();
    antlr4::tree::TerminalNode* ARG_ACTION_WS(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_NEWLINE();
    antlr4::tree::TerminalNode* ARG_ACTION_NEWLINE(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ArgActionBlockContext* argActionBlock();

  class  ArgActionParametersContext : public antlr4::ParserRuleContext {
  public:
    ANTLRv4Parser::ArgActionParameterContext *argActionParameterContext = nullptr;;
    std::vector<ArgActionParameterContext *> parameters;;
    ArgActionParametersContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *BEGIN_ARG_ACTION();
    antlr4::tree::TerminalNode *END_ARG_ACTION();
    std::vector<IgnoredContext *> ignored();
    IgnoredContext* ignored(size_t i);
    std::vector<ArgActionParameterContext *> argActionParameter();
    ArgActionParameterContext* argActionParameter(size_t i);
    std::vector<antlr4::tree::TerminalNode *> ARG_ACTION_COMMA();
    antlr4::tree::TerminalNode* ARG_ACTION_COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ArgActionParametersContext* argActionParameters();

  class  ArgActionParameterContext : public antlr4::ParserRuleContext {
  public:
    ANTLRv4Parser::ArgActionParameterTypeContext *type = nullptr;;
    antlr4::Token *name = nullptr;;
    ArgActionParameterContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *ARG_ACTION_WORD();
    std::vector<IgnoredContext *> ignored();
    IgnoredContext* ignored(size_t i);
    ArgActionParameterTypeContext *argActionParameterType();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ArgActionParameterContext* argActionParameter();

  class  ArgActionParameterTypeContext : public antlr4::ParserRuleContext {
  public:
    ArgActionParameterTypeContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<ArgActionParameterTypePartContext *> argActionParameterTypePart();
    ArgActionParameterTypePartContext* argActionParameterTypePart(size_t i);
    std::vector<IgnoredContext *> ignored();
    IgnoredContext* ignored(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ArgActionParameterTypeContext* argActionParameterType();

  class  ArgActionParameterTypePartContext : public antlr4::ParserRuleContext {
  public:
    ArgActionParameterTypePartContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *ARG_ACTION_WORD();
    antlr4::tree::TerminalNode *ARG_ACTION_LT();
    antlr4::tree::TerminalNode *ARG_ACTION_GT();
    ArgActionParameterTypeContext *argActionParameterType();
    antlr4::tree::TerminalNode *ARG_ACTION_LPAREN();
    antlr4::tree::TerminalNode *ARG_ACTION_RPAREN();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ArgActionParameterTypePartContext* argActionParameterTypePart();

  class  IgnoredContext : public antlr4::ParserRuleContext {
  public:
    IgnoredContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *ACTION_WS();
    antlr4::tree::TerminalNode *ACTION_NEWLINE();
    antlr4::tree::TerminalNode *ACTION_COMMENT();
    antlr4::tree::TerminalNode *ARG_ACTION_WS();
    antlr4::tree::TerminalNode *ARG_ACTION_NEWLINE();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  IgnoredContext* ignored();

  class  ActionContext : public antlr4::ParserRuleContext {
  public:
    ActionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *AT();
    IdContext *id();
    ActionBlockContext *actionBlock();
    ActionScopeNameContext *actionScopeName();
    antlr4::tree::TerminalNode *COLONCOLON();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ActionContext* action();

  class  ActionScopeNameContext : public antlr4::ParserRuleContext {
  public:
    ActionScopeNameContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *LEXER();
    antlr4::tree::TerminalNode *PARSER();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ActionScopeNameContext* actionScopeName();

  class  ModeSpecContext : public antlr4::ParserRuleContext {
  public:
    ModeSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *MODE();
    IdContext *id();
    antlr4::tree::TerminalNode *SEMI();
    std::vector<RuleSpecContext *> ruleSpec();
    RuleSpecContext* ruleSpec(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ModeSpecContext* modeSpec();

  class  RulesContext : public antlr4::ParserRuleContext {
  public:
    RulesContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<RuleSpecContext *> ruleSpec();
    RuleSpecContext* ruleSpec(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RulesContext* rules();

  class  RuleSpecContext : public antlr4::ParserRuleContext {
  public:
    RuleSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    ParserRuleSpecContext *parserRuleSpec();
    LexerRuleContext *lexerRule();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleSpecContext* ruleSpec();

  class  ParserRuleSpecContext : public antlr4::ParserRuleContext {
  public:
    antlr4::Token *name = nullptr;;
    ParserRuleSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    RulePrequelsContext *rulePrequels();
    antlr4::tree::TerminalNode *COLON();
    RuleBlockContext *ruleBlock();
    antlr4::tree::TerminalNode *SEMI();
    ExceptionGroupContext *exceptionGroup();
    antlr4::tree::TerminalNode *RULE_REF();
    antlr4::tree::TerminalNode *DOC_COMMENT();
    RuleModifiersContext *ruleModifiers();
    ArgActionParametersContext *argActionParameters();
    RuleReturnsContext *ruleReturns();
    ThrowsSpecContext *throwsSpec();
    LocalsSpecContext *localsSpec();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ParserRuleSpecContext* parserRuleSpec();

  class  ExceptionGroupContext : public antlr4::ParserRuleContext {
  public:
    ExceptionGroupContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<ExceptionHandlerContext *> exceptionHandler();
    ExceptionHandlerContext* exceptionHandler(size_t i);
    FinallyClauseContext *finallyClause();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ExceptionGroupContext* exceptionGroup();

  class  ExceptionHandlerContext : public antlr4::ParserRuleContext {
  public:
    ExceptionHandlerContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *CATCH();
    ArgActionBlockContext *argActionBlock();
    ActionBlockContext *actionBlock();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ExceptionHandlerContext* exceptionHandler();

  class  FinallyClauseContext : public antlr4::ParserRuleContext {
  public:
    FinallyClauseContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *FINALLY();
    ActionBlockContext *actionBlock();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  FinallyClauseContext* finallyClause();

  class  RulePrequelsContext : public antlr4::ParserRuleContext {
  public:
    RulePrequelsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<RulePrequelContext *> rulePrequel();
    RulePrequelContext* rulePrequel(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RulePrequelsContext* rulePrequels();

  class  RulePrequelContext : public antlr4::ParserRuleContext {
  public:
    RulePrequelContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    OptionsSpecContext *optionsSpec();
    RuleActionContext *ruleAction();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RulePrequelContext* rulePrequel();

  class  RuleReturnsContext : public antlr4::ParserRuleContext {
  public:
    RuleReturnsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *RETURNS();
    ArgActionParametersContext *argActionParameters();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleReturnsContext* ruleReturns();

  class  ThrowsSpecContext : public antlr4::ParserRuleContext {
  public:
    ThrowsSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *THROWS();
    std::vector<QidContext *> qid();
    QidContext* qid(size_t i);
    std::vector<antlr4::tree::TerminalNode *> COMMA();
    antlr4::tree::TerminalNode* COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ThrowsSpecContext* throwsSpec();

  class  LocalsSpecContext : public antlr4::ParserRuleContext {
  public:
    LocalsSpecContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LOCALS();
    ArgActionParametersContext *argActionParameters();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LocalsSpecContext* localsSpec();

  class  RuleActionContext : public antlr4::ParserRuleContext {
  public:
    RuleActionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *AT();
    IdContext *id();
    ActionBlockContext *actionBlock();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleActionContext* ruleAction();

  class  RuleModifiersContext : public antlr4::ParserRuleContext {
  public:
    RuleModifiersContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<RuleModifierContext *> ruleModifier();
    RuleModifierContext* ruleModifier(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleModifiersContext* ruleModifiers();

  class  RuleModifierContext : public antlr4::ParserRuleContext {
  public:
    RuleModifierContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *PUBLIC();
    antlr4::tree::TerminalNode *PRIVATE();
    antlr4::tree::TerminalNode *PROTECTED();
    antlr4::tree::TerminalNode *FRAGMENT();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleModifierContext* ruleModifier();

  class  RuleBlockContext : public antlr4::ParserRuleContext {
  public:
    RuleBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    RuleAltListContext *ruleAltList();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleBlockContext* ruleBlock();

  class  RuleAltListContext : public antlr4::ParserRuleContext {
  public:
    RuleAltListContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<LabeledAltContext *> labeledAlt();
    LabeledAltContext* labeledAlt(size_t i);
    std::vector<antlr4::tree::TerminalNode *> OR();
    antlr4::tree::TerminalNode* OR(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RuleAltListContext* ruleAltList();

  class  LabeledAltContext : public antlr4::ParserRuleContext {
  public:
    boolean hasPOUND;
    antlr4::Token *poundExisted = nullptr;;
    LabeledAltContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    AlternativeContext *alternative();
    IdContext *id();
    antlr4::tree::TerminalNode *POUND();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LabeledAltContext* labeledAlt();

  class  LexerRuleContext : public antlr4::ParserRuleContext {
  public:
    antlr4::Token *name = nullptr;;
    LexerRuleContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *COLON();
    LexerRuleBlockContext *lexerRuleBlock();
    antlr4::tree::TerminalNode *SEMI();
    antlr4::tree::TerminalNode *TOKEN_REF();
    antlr4::tree::TerminalNode *DOC_COMMENT();
    antlr4::tree::TerminalNode *FRAGMENT();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerRuleContext* lexerRule();

  class  LexerRuleBlockContext : public antlr4::ParserRuleContext {
  public:
    LexerRuleBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    LexerAltListContext *lexerAltList();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerRuleBlockContext* lexerRuleBlock();

  class  LexerAltListContext : public antlr4::ParserRuleContext {
  public:
    LexerAltListContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<LexerAltContext *> lexerAlt();
    LexerAltContext* lexerAlt(size_t i);
    std::vector<antlr4::tree::TerminalNode *> OR();
    antlr4::tree::TerminalNode* OR(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerAltListContext* lexerAltList();

  class  LexerAltContext : public antlr4::ParserRuleContext {
  public:
    LexerAltContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    LexerElementsContext *lexerElements();
    LexerCommandsContext *lexerCommands();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerAltContext* lexerAlt();

  class  LexerElementsContext : public antlr4::ParserRuleContext {
  public:
    LexerElementsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<LexerElementContext *> lexerElement();
    LexerElementContext* lexerElement(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerElementsContext* lexerElements();

  class  LexerElementContext : public antlr4::ParserRuleContext {
  public:
    LexerElementContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    LabeledLexerElementContext *labeledLexerElement();
    EbnfSuffixContext *ebnfSuffix();
    LexerAtomContext *lexerAtom();
    LexerBlockContext *lexerBlock();
    ActionBlockContext *actionBlock();
    antlr4::tree::TerminalNode *QUESTION();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerElementContext* lexerElement();

  class  LabeledLexerElementContext : public antlr4::ParserRuleContext {
  public:
    antlr4::Token *ass = nullptr;;
    LabeledLexerElementContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *ASSIGN();
    antlr4::tree::TerminalNode *PLUS_ASSIGN();
    LexerAtomContext *lexerAtom();
    BlockContext *block();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LabeledLexerElementContext* labeledLexerElement();

  class  LexerBlockContext : public antlr4::ParserRuleContext {
  public:
    LexerBlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LPAREN();
    LexerAltListContext *lexerAltList();
    antlr4::tree::TerminalNode *RPAREN();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerBlockContext* lexerBlock();

  class  LexerCommandsContext : public antlr4::ParserRuleContext {
  public:
    LexerCommandsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *RARROW();
    std::vector<LexerCommandContext *> lexerCommand();
    LexerCommandContext* lexerCommand(size_t i);
    std::vector<antlr4::tree::TerminalNode *> COMMA();
    antlr4::tree::TerminalNode* COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerCommandsContext* lexerCommands();

  class  LexerCommandContext : public antlr4::ParserRuleContext {
  public:
    LexerCommandContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    LexerCommandNameContext *lexerCommandName();
    antlr4::tree::TerminalNode *LPAREN();
    LexerCommandExprContext *lexerCommandExpr();
    antlr4::tree::TerminalNode *RPAREN();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerCommandContext* lexerCommand();

  class  LexerCommandNameContext : public antlr4::ParserRuleContext {
  public:
    LexerCommandNameContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *MODE();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerCommandNameContext* lexerCommandName();

  class  LexerCommandExprContext : public antlr4::ParserRuleContext {
  public:
    LexerCommandExprContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *INT();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerCommandExprContext* lexerCommandExpr();

  class  AltListContext : public antlr4::ParserRuleContext {
  public:
    AltListContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<AlternativeContext *> alternative();
    AlternativeContext* alternative(size_t i);
    std::vector<antlr4::tree::TerminalNode *> OR();
    antlr4::tree::TerminalNode* OR(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  AltListContext* altList();

  class  AlternativeContext : public antlr4::ParserRuleContext {
  public:
    AlternativeContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    ElementsContext *elements();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  AlternativeContext* alternative();

  class  ElementsContext : public antlr4::ParserRuleContext {
  public:
    ElementsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<ElementContext *> element();
    ElementContext* element(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ElementsContext* elements();

  class  ElementContext : public antlr4::ParserRuleContext {
  public:
    ElementContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    LabeledElementContext *labeledElement();
    EbnfSuffixContext *ebnfSuffix();
    AtomContext *atom();
    EbnfContext *ebnf();
    ActionBlockContext *actionBlock();
    antlr4::tree::TerminalNode *QUESTION();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ElementContext* element();

  class  LabeledElementContext : public antlr4::ParserRuleContext {
  public:
    ANTLRv4Parser::IdContext *label = nullptr;;
    antlr4::Token *ass = nullptr;;
    LabeledElementContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    IdContext *id();
    antlr4::tree::TerminalNode *ASSIGN();
    antlr4::tree::TerminalNode *PLUS_ASSIGN();
    AtomContext *atom();
    BlockContext *block();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LabeledElementContext* labeledElement();

  class  EbnfContext : public antlr4::ParserRuleContext {
  public:
    EbnfContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    BlockContext *block();
    BlockSuffixContext *blockSuffix();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  EbnfContext* ebnf();

  class  BlockSuffixContext : public antlr4::ParserRuleContext {
  public:
    BlockSuffixContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    EbnfSuffixContext *ebnfSuffix();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  BlockSuffixContext* blockSuffix();

  class  EbnfSuffixContext : public antlr4::ParserRuleContext {
  public:
    EbnfSuffixContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *QUESTION();
    antlr4::tree::TerminalNode *STAR();
    antlr4::tree::TerminalNode *PLUS();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  EbnfSuffixContext* ebnfSuffix();

  class  LexerAtomContext : public antlr4::ParserRuleContext {
  public:
    LexerAtomContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    RangeContext *range();
    TerminalContext *terminal();
    antlr4::tree::TerminalNode *RULE_REF();
    NotSetContext *notSet();
    antlr4::tree::TerminalNode *LEXER_CHAR_SET();
    antlr4::tree::TerminalNode *DOT();
    ElementOptionsContext *elementOptions();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  LexerAtomContext* lexerAtom();

  class  AtomContext : public antlr4::ParserRuleContext {
  public:
    AtomContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    RangeContext *range();
    TerminalContext *terminal();
    RulerefContext *ruleref();
    NotSetContext *notSet();
    antlr4::tree::TerminalNode *DOT();
    ElementOptionsContext *elementOptions();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  AtomContext* atom();

  class  NotSetContext : public antlr4::ParserRuleContext {
  public:
    NotSetContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *NOT();
    SetElementContext *setElement();
    BlockSetContext *blockSet();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  NotSetContext* notSet();

  class  BlockSetContext : public antlr4::ParserRuleContext {
  public:
    BlockSetContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LPAREN();
    std::vector<SetElementContext *> setElement();
    SetElementContext* setElement(size_t i);
    antlr4::tree::TerminalNode *RPAREN();
    std::vector<antlr4::tree::TerminalNode *> OR();
    antlr4::tree::TerminalNode* OR(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  BlockSetContext* blockSet();

  class  SetElementContext : public antlr4::ParserRuleContext {
  public:
    SetElementContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *TOKEN_REF();
    antlr4::tree::TerminalNode *STRING_LITERAL();
    RangeContext *range();
    antlr4::tree::TerminalNode *LEXER_CHAR_SET();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  SetElementContext* setElement();

  class  BlockContext : public antlr4::ParserRuleContext {
  public:
    BlockContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LPAREN();
    AltListContext *altList();
    antlr4::tree::TerminalNode *RPAREN();
    antlr4::tree::TerminalNode *COLON();
    OptionsSpecContext *optionsSpec();
    std::vector<RuleActionContext *> ruleAction();
    RuleActionContext* ruleAction(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  BlockContext* block();

  class  RulerefContext : public antlr4::ParserRuleContext {
  public:
    RulerefContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *RULE_REF();
    ArgActionBlockContext *argActionBlock();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RulerefContext* ruleref();

  class  RangeContext : public antlr4::ParserRuleContext {
  public:
    RangeContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<antlr4::tree::TerminalNode *> STRING_LITERAL();
    antlr4::tree::TerminalNode* STRING_LITERAL(size_t i);
    antlr4::tree::TerminalNode *RANGE();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  RangeContext* range();

  class  TerminalContext : public antlr4::ParserRuleContext {
  public:
    TerminalContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *TOKEN_REF();
    ElementOptionsContext *elementOptions();
    antlr4::tree::TerminalNode *STRING_LITERAL();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  TerminalContext* terminal();

  class  ElementOptionsContext : public antlr4::ParserRuleContext {
  public:
    ElementOptionsContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *LT();
    std::vector<ElementOptionContext *> elementOption();
    ElementOptionContext* elementOption(size_t i);
    antlr4::tree::TerminalNode *GT();
    std::vector<antlr4::tree::TerminalNode *> COMMA();
    antlr4::tree::TerminalNode* COMMA(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ElementOptionsContext* elementOptions();

  class  ElementOptionContext : public antlr4::ParserRuleContext {
  public:
    ElementOptionContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    QidContext *qid();
    IdContext *id();
    antlr4::tree::TerminalNode *ASSIGN();
    antlr4::tree::TerminalNode *STRING_LITERAL();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  ElementOptionContext* elementOption();

  class  IdContext : public antlr4::ParserRuleContext {
  public:
    IdContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    antlr4::tree::TerminalNode *RULE_REF();
    antlr4::tree::TerminalNode *TOKEN_REF();

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  IdContext* id();

  class  QidContext : public antlr4::ParserRuleContext {
  public:
    QidContext(antlr4::ParserRuleContext *parent, size_t invokingState);
    virtual size_t getRuleIndex() const override;
    std::vector<IdContext *> id();
    IdContext* id(size_t i);
    std::vector<antlr4::tree::TerminalNode *> DOT();
    antlr4::tree::TerminalNode* DOT(size_t i);

    virtual void enterRule(antlr4::tree::ParseTreeListener *listener) override;
    virtual void exitRule(antlr4::tree::ParseTreeListener *listener) override;

    virtual antlrcpp::Any accept(antlr4::tree::ParseTreeVisitor *visitor) override;
   
  };

  QidContext* qid();


private:
  static std::vector<antlr4::dfa::DFA> _decisionToDFA;
  static antlr4::atn::PredictionContextCache _sharedContextCache;
  static std::vector<std::string> _ruleNames;
  static std::vector<std::string> _tokenNames;

  static std::vector<std::string> _literalNames;
  static std::vector<std::string> _symbolicNames;
  static antlr4::dfa::Vocabulary _vocabulary;
  static antlr4::atn::ATN _atn;
  static std::vector<uint16_t> _serializedATN;


  struct Initializer {
    Initializer();
  };
  static Initializer _init;
};

